package com.nmgjc;

import com.github.davidfantasy.mybatisplus.generatorui.GeneratorConfig;
import com.github.davidfantasy.mybatisplus.generatorui.MybatisPlusToolsApplication;
import com.github.davidfantasy.mybatisplus.generatorui.mbp.NameConverter;

public class CodeGenerator {

    //    public static String url = "jdbc:oracle:thin:@127.0.0.1:1521/orclu8";
    public static String url = "jdbc:oracle:thin:@172.26.218.39:1521/ORCLU8";

    public static String userName = "minsheng";

    public static String password = "y3s2LJWrSrJLkZ";

    //    public static String driverClassName = "oracle.jdbc.OracleDriver";
    public static String driverClassName = "oracle.jdbc.OracleDriver";

    // 数据库schema，POSTGRE_SQL,ORACLE,DB2类型的数据库需要指定
    public static String schemaName = "MINSHENG";

    public static String packageName = "com.nmgjc";

    public static void main(String[] args) {
        GeneratorConfig config = GeneratorConfig.builder().jdbcUrl(url)
                .userName(userName)
                .password(password)
                .driverClassName(driverClassName)
                .schemaName(schemaName)
                .nameConverter(new NameConverter() {
                    @Override
                    public String serviceNameConvert(String tableName) {
                        return tableName + "Service";
                    }
                })
                .basePackage(packageName)
                .port(8068)
                .build();
        MybatisPlusToolsApplication.run(config);
    }
}
